package com.rocsea.robot.utils;

import com.rocsea.robot.model.enums.DeleteTypeEnum;

/**
 * @Author RocSea
 * @Date 2023/5/12
 */
public final class KettleTranslateUtils {
    private KettleTranslateUtils() {}

    public static int getBuildModuleValue(String text) {
        int moduleType = -1;
        switch (text) {
            case "国内现网":
                moduleType = 2;
                break;
            case "国内重构":
                moduleType = 6;
                break;
            case "国内落地":
                moduleType = 1;
                break;
            case "新三方库":
                moduleType = 41;
                break;
        }
        return moduleType;
    }

    public static String getBuildModuleText(String serviceModule) {
        String buildModule = "";
        switch (serviceModule) {
            case "国内现网":
                buildModule = "dm";
                break;
            case "国内重构":
                buildModule = "onshore";
                break;
            case "国内落地":
                buildModule = "internation";
                break;
            case "新三方库":
                buildModule = "third";
                break;
        }
        return buildModule;
    }

    public static int getServiceModuleByExcel(String text) {
        int moduleType = -1;
        switch (text) {
            case "国内现网":
                moduleType = 2;
                break;
            case "国内重构":
                moduleType = 1;
                break;
            case "国内落地":
                moduleType = 3;
                break;
            case "新三方库":
                moduleType = 4;
                break;
        }
        return moduleType;
    }

    public static int getDeleteType(boolean physicalDelete) {
        if (physicalDelete) {
            return DeleteTypeEnum.PHYSICAL.getValue();
        }
        return DeleteTypeEnum.LOGIC.getValue();
    }
}
